import {
  MOD_EFFICIENCY,
  MOD_PRODUCTION,
  MOD_ENERGY,
  MOD_MORE
} from "./modStack";
import { MainService } from "src/app/main.service";

export const ModData = {
  f: {
    name: "浪费/效率",
    description: "生产产量",
    tooltip: "增加或减少产出的资源; 叠加",
    getBonus: (num: DecimalSource) => {
      return (
        (new Decimal(num).gt(0) ? "+" : "") +
        MainService.formatPipe.transform(
          Decimal.multiply(MOD_EFFICIENCY, num).times(100)
        ) +
        "%"
      );
    },
    min: -9
  },
  p: {
    name: "产出/消耗",
    description: "生产和消耗",
    tooltip:
      "增加或减少产出和消耗的资源; 叠加",
    getBonus: (num: DecimalSource) => {
      return (
        (new Decimal(num).gt(0) ? "+" : "") +
        MainService.formatPipe.transform(
          Decimal.multiply(MOD_PRODUCTION, num).times(100)
        ) +
        "%"
      );
    },
    min: -3
  },
  e: {
    name: "能源密集型/节能型",
    description: "能源使用",
    tooltip: "增加或减少能源使用量",
    max: 10,
    getBonus: (num: DecimalSource) => {
      return (
        (new Decimal(num).lt(0) ? "+" : "") +
        MainService.formatPipe.transform(
          Decimal.multiply(MOD_ENERGY, num).times(100)
        ) +
        "%"
      );
    }
  },
  s: {
    name: "昂贵/经济",
    description: "机器人价格",
    tooltip:
      "增加或减少制造无人机所需的机器人组件数量",
    max: 7,
    getBonus: (num: DecimalSource) => {
      return MainService.formatPipe.transform(
        new Decimal(1).plus(new Decimal(num).times(-0.1))
      );
    }
  },
  m: {
    name: "更多无人机",
    description: "更多无人机",
    tooltip: "增加你可以拥有的无人机数量",
    min: 0,
    getBonus: (num: DecimalSource) => {
      return (
        "+" +
        MainService.formatPipe.transform(
          new Decimal(num).times(100).times(MOD_MORE)
        ) +
        "%"
      );
    }
  }
};
